package fr.sharpe.app.earthvisualizationproject.controller;

import java.util.ArrayList;

import com.mycila.event.api.Dispatcher;
import com.mycila.event.api.topic.Topics;

import fr.sharpe.app.earthvisualizationdatamodel.Icon;
import fr.sharpe.app.earthvisualizationdatamodel.Surface;
import fr.sharpe.app.earthvisualizationproject.controller.servers.RmiServer;
import fr.sharpe.app.earthvisualizationproject.event.AddIconsEvent;
import fr.sharpe.app.earthvisualizationproject.event.AddTextsEvent;

public class InputHubController {

	private Dispatcher dispatcher;
	
	public InputHubController(Dispatcher dispatcherIn)
	{
		
			this.dispatcher = dispatcherIn;
			
			RmiServer server = new RmiServer("localhost", 1099, this.dispatcher);
			server.startService();

//			ArrayList<Surface> icons = new ArrayList<Surface>();
//			for(int j=0; j<1000; j++)
//	        {	
//	    		double lat = Math.random()*90;
//	    		double lon = Math.random()*90;
//				Icon ico = new Icon("TestIco"+j,lat, lon, "images/APP.png",null);
//				icons.add(ico);
//	        }
//			dispatcher.publish(Topics.topic("AddIcons"), new AddIconsEvent(icons, "testico"));
		
	}
}
